<?php
namespace app\common\model;
use app\common\model\CommonModel;
use think\Db;

class Activity extends CommonModel
{
	/**
    * 添加活动信息
	*/
	public function serActivity($data)
	{
		return $this->insert($data);
	}
    /**
	* 获取信息列表
	*/
	public function getActivityList($where,$limit,$page)
	{
	   $item = $this->where($where)->paginate($limit,false,['page'=>$page]);
       return empty($item) ? array():$item->toArray();
	}
    /**
    * 获取活动信息
    */
    public function ActivityList($where,$order = '',$find = 'select',$field = '')
    {
        $obj = $this->where($where);
        if($order)
        {
            $obj->order($order);
        }
        if($field)
        {
            $obj->field($field);
        }
        return $obj->$find();
    }
    /**
	* 编辑活动信息
	*/
	public function updateActivity($where,$data)
	{
		return $this->where($where)->update($data);
	}
    /**
	* 删除
	*/
	public function delActivity($where)
	{
		return $this->where($where)->delete();
	}
}
